import React, { useState, useEffect } from 'react';
import './index.scss';
import { history } from 'umi';

// import uploadimg from '@/assets/A0启动图.jpg';
export default function BootPage(props) {
  let [num, setnum] = useState(2);
  var data = null;

  useEffect(() => {
    data = setInterval(() => {
      setnum(--num);
      if (num == 0) {
        history.push({
          pathname: '/home',
        });
        clearInterval(data);
      }
    }, 1000);
  }, []);
  let tiao = () => {
    history.push({
      pathname: '/home',
    });
    clearInterval(data);
  };

  return (
    <div className="upload">
      <div className="upload_img">
        <b className="miao" onClick={tiao}>
          {num}跳过
        </b>
        {/* <img className="upload_img" src={uploadimg} alt="" /> */}
      </div>
    </div>
  );
}
